<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="FriendsNearby.Fbml.Default" %>
<fb:FacebookApplication ID="fbApplication" runat="server" Mode="Fbml"
    EnableExternalBrowsing="true"
    ApplicationName="FriendsNearby" />
<fb:fbml version="1.0">
<fb:header decoration="add_border">Contacts Nearby</fb:header>    


<div style="padding:10px;">
    
    <b>My Contacts Nearby</b>
    &nbsp;|&nbsp;
    <a style="font-weight:bold" href="<%=FriendsNearby.ConfigHelper.FacebookUrl%>EditPreferences.aspx">Edit Preferences</a>
    &nbsp;|&nbsp;
    <a style="font-weight:bold" href="<%=FriendsNearby.ConfigHelper.FacebookUrl%>Faq.aspx#how_this_information_is_used">How this information is used?</a>    
    &nbsp;|&nbsp;
    <a style="font-weight:bold" href="http://instedd.org/contactsnearby" target="_blank">About InSTEDD</a>    
    
    <fb:Success ID="statusMessage" runat="server" />
    
    <div style="padding-top:5px;padding-left:5px;padding-right:5px;">
        <fb:iframe src="<%=FriendsNearby.ConfigHelper.ApplicationUrl%>Fbml/PeopleNearbyMap.aspx" height="600" width="100%" frameborder="0" scrolling="no">
            Map (IFrames support is required.)
        </fb:iframe><br />
    </div>
    <table border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td>
    <fb:share-button class="meta" >
    <meta name="title" content="Connect with me on Contacts Nearby" />
    <meta name="description" content="Contacts Nearby allows you to add your current location to your facebook profile and see the location of your facebook friends." />
    <link rel="target_url" href="http://www.facebook.com/add.php?api_key=df75528923d809c46c5a1339a26c050d&v=1.0" />
    </fb:share-button>
    </td>
    <td>&nbsp; this application with other friends on facebook!
    </td>
    </tr>
    </table>
    <br />
    <div id="friendNearbyList" style="padding-top:0px;padding-left:5px;padding-right:0px;">
    </div>
    <br />
    <br />
    Contacts Nearby Technical Preview. Questions? Suggestions? Feedback? <a target="_blank" href="http://instedd.org/techforums/">Please come to our Forums</a>.
    <script>
<!--
function loadFriends()
{
  var ajax = new Ajax();
  ajax.responseType = Ajax.FBML;
  ajax.ondone = function(data) {
        document.getElementById('friendNearbyList').setInnerFBML(data);
      }
  ajax.onerror = function(data) {
        document.getElementById('friendNearbyList').setInnerFBML(friendlistfailed);
  }
  ajax.requireLogin = true;
  ajax.post('<%=FriendsNearby.ConfigHelper.ApplicationUrl%>/Fbml/FriendsNearbyList.aspx');
} 
document.getElementById('friendNearbyList').setInnerFBML(friendlistwait);
loadFriends();
//-->
</script>
<fb:js-string var="friendlistfailed">
     <b>Loading contacs list failed. <a href="#" onclick="document.getElementById('friendNearbyList').setInnerFBML(friendlistwait);loadFriends();return false;">please try again</a>.</b>
</fb:js-string>

<fb:js-string var="friendlistwait">
     <img style="vertical-align: middle" src="<%=FriendsNearby.ConfigHelper.ApplicationUrl%>/Fbml/Images/wait.gif" />  <b>Please wait while a list of your contacts is being retrieved...<b>
</fb:js-string>
</div>
</fb:fbml>
